<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改信息弹出层</title>
    <link rel="stylesheet" href="{{URL::asset('js/layui-v2.3.0/layui/css/layui.css')}}">
    <link rel="stylesheet" href="{{URL::asset('css/music/add_company.css')}}">
    <link rel="stylesheet" href="{{url('/common/css/element.css')}}">
    <style>
        .avatar-uploader .el-upload {
            border: 1px dashed #d9d9d9;
            border-radius: 6px;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }
        .avatar-uploader .el-upload:hover {
            border-color: #409EFF;
        }
        .avatar-uploader-icon {
            font-size: 28px;
            color: #8c939d;
            width: 178px;
            height: 178px;
            line-height: 178px;
            text-align: center;
        }
        .avatar {
            width: 360px;
            height: 470px;
            display: block;
        }
    </style>
</head>
<body>
<div class="add_box manage_box" style="" >
    <h2>修改信息</h2>
    <form action="updateCompany" method="post">
        {{csrf_field()}}
        <p><label for=""><input type="hidden" name="id" value="{{$detail['id']}}" required></label></p>
        <p><label for="">公司名：<input type="text" name="company_name" value="{{$detail['company_name']}}" required></label></p>
        <p><label for="">联系人：<input type="text" name="phone_name" value="{{$detail['phone_name']}}" required></label></p>
        <p><label for="">地&nbsp;&nbsp;&nbsp;址：<input type="text" name="address" value="{{$detail['address']}}" required></label></p>
        <p><label for="">电&nbsp;&nbsp;&nbsp;话：<input type="text" name="phone" value="{{$detail['phone']}}" required></label></p>
        <p><label for="">代&nbsp;&nbsp;&nbsp;码：<input type="text" name="code" value="{{$detail['code']}}" required></label></p>
        <p><label for=""><input type="hidden" name="company_image" required></label></p>
        <div class="uploading">
            <div class="left_img">
                <p>上传公章：</p>
                <div id="app">
                    <el-upload
                            class="avatar-uploader"
                            action="http://{{$_SERVER['HTTP_HOST']}}/admin/upload"
                            :show-file-list="false"
                            :on-success="handleAvatarSuccess">
                        <img v-if="imageUrl" :src="imageUrl" class="avatar">
                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                    <p>点击图片修改，注意：上传公章只能使用gif、png图像</p>
                </div>
            </div>
        </div>
        <div class="btn_box"><button type="submit" class="ConfirmToAdd">保存信息</button></div>
    </form>
</div>
</body>
</html>
{{--<script type="text/javascript" src="{{URL::asset('common/js/jquery-1.10.1.min.js')}}"></script>--}}
<script type="text/javascript" src="{{URL::asset('js/layui-v2.3.0/layui/layui.all.js')}}"></script>
<script src="{{url('/common/js/element/vue.js')}}"></script>
<script src="{{url('/common/js/element/element.js')}}"></script>
<script>
    new Vue ({
        el: '#app',
        data() {
            return {
                imageUrl: '{{$detail["company_image"]}}'
            };
        },
        methods: {
            handleAvatarSuccess(res, file) {
                $("input[name='company_image']").val(res.url)
                this.imageUrl = URL.createObjectURL(file.raw);
            }
        }
    })
</script>
